<?php	
/**
 * @version		$Id: graphic.php 2011.08.11 thierry $
 * @package		admin.models
 * @subpackage	com_projid
 * @copyright	Copyright (C) 2011 Pojid All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */
defined('_JEXEC') or die('Restricted access');
jimport('joomla.application.component.modeladmin');

class ProjidModelGraphic extends JModelAdmin
	{
	
		public function getTable($type = 'Graphic', $prefix = 'ProjidTable', $config = array()) 
			{
				return JTable::getInstance($type, $prefix, $config);
			}
		
		public function getForm($data = array(), $loadData = true) 
			{
				// Get the form.
				$form = $this->loadForm('com_projid.graphic', 'graphic', array('control' => 'jform', 'load_data' => $loadData));
				if (empty($form)) 
				{
					return false;
				}
				return $form;
			}
	
		protected function loadFormData() 
			{
				// Check the session for previously entered form data.
				$data = JFactory::getApplication()->getUserState('com_projid.edit.graphic.data', array());
				if (empty($data)) 
				{
					$data = $this->getItem();
				}
				return $data;
			}
	}
